<template>
  <div>
    列表组件
    <ul>
      <li v-for="v in list" :key="v">{{ v }}</li>
    </ul>
  </div>
</template>

<script>
import axios from 'axios'
export default {
  name: 'List',
  mounted() {
    console.log('列表组件挂在完毕');
    axios.get('/list').then(resp => {
      console.log(resp.data);
      this.list = resp.data
    })
  },
  destroyed() {
    console.log('列表组件销毁了');
  },
  data() {
    return {
      list: []
    }
  }
}
</script>